package com.itheima.controller;



import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.itheima.service.UserService;

@Controller
public class LoginController {
	@Autowired
	UserService userService;
	@RequestMapping("/login")
	public String handleFormUpload(@RequestParam(value = "username",required = false) String username,
			@RequestParam(value = "password",required = false)String password, HttpServletRequest request) {
		boolean flag = userService.loginUser(username, password);
		System.out.println("html直接进入了控制器");
		if(flag) {
			return "filelist";
		}else {
			return "error";
		}
	}
}
